﻿using Microsoft.Win32;

namespace _68_C_实现添加删除系统右键菜单
{
    internal class Program
    {
        static void Main(string[] args)
        {
            RegistryKey rootkey = Registry.ClassesRoot.CreateSubKey(@"*\shell");
            //rootkey.DeleteSubKeyTree("我的记事本菜单");//移除

            RegistryKey registryKey = rootkey.CreateSubKey("我的记事本菜单");
            registryKey.SetValue("", "我的记事本菜单");
            RegistryKey command = registryKey.CreateSubKey(@"command");
            command.SetValue("",@"notepad.exe");
            rootkey.Close();
            registryKey.Close();
            command.Close();
        }
    }
}
